﻿using System.Collections.Generic;
using BFlatCompile.Serializer;

namespace BFlatCompile
{
	internal class Program
	{
		private static void Main(string[] args)
		{
#if DEBUG
			args = "C:\\Foo\\MyApp\\myapp.bfp -windows".Split(' ');
			new Compiler(args).Compile();
#else
			try
			{
				new Compiler(args).Compile();
			}
			catch (BFlatCompile.TokenizerException e)
			{
				System.Console.WriteLine(e.Message);
			}
			catch (BFlatCompile.ParserException e)
			{
				System.Console.WriteLine(e.Message);
			}
			catch (BFlatCompile.InvalidUsageException e)
			{
				System.Console.WriteLine(e.Message);
			}
			catch (System.Exception e)
			{
				System.Console.WriteLine(e.Message);
				System.Console.WriteLine(
					"---------------------------------------------------\n" +
					"NOTE: THIS EXCEPTION IS NOT WRAPPED! THIS IS A BUG!\n" +
					"---------------------------------------------------");
			}
#endif
		}
	}
}
